using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using FSS.DAL.DBManagers;
using FSS.BLL.Entities;
namespace FSS.BLL.Services
{
	#region IVoucherDetailMapService

	/// <summary>
	/// VoucherDetailMapService object for Ibatis mapped table 'VoucherDetailMap'.
	/// </summary>
	public class IVoucherDetailMapService : BaseSqlMapDao
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(IVoucherDetailMapService).Name);
	  	
		public IList<VoucherDetailMapEntity> LoadAll()
        {
            try
            {
                return ExecuteQueryForList< VoucherDetailMapEntity>("VoucherDetailMapLoadAll", null);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
       public VoucherDetailMapEntity LoadByPrimaryKey(VoucherDetailMapEntity objE)
        {
            try
            {
                return ExecuteQueryForObject< VoucherDetailMapEntity>("VoucherDetailMapLoadByPrimaryKey", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
        
        /// <summary>
        /// add new VoucherDetailMap to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Insert(VoucherDetailMapEntity objE)
        {
            try
            {
                ExecuteInsert("VoucherDetailMapInsert", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
        /// <summary>
        /// update VoucherDetailMap to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Update(VoucherDetailMapEntity objE)
        {
            try
            {
                ExecuteUpdate("VoucherDetailMapUpdate", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
        /// <summary>
        /// delete VoucherDetailMap to DB 
        /// </summary>
        /// <param name="objE"></param>
        /// <returns></returns>
        public int Delete(VoucherDetailMapEntity objE)
        {
            try
            {
                ExecuteDelete("VoucherDetailMapDelete", objE);
                return 1;
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return 0;
            }
        }
	}
	#endregion  
}
